# Contributor: Andy Postnikov <apostnikov@gmail.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php8-pecl-csv
_extname=CSV
pkgver=0.4.2
pkgrel=0
pkgdesc="CSV PHP 8.0 extension - PECL"
url="https://pecl.php.net/package/CSV"
arch="all"
license="PHP-3.01"
depends="php8-common"
makedepends="php8-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver

build() {
	phpize8
	./configure --prefix=/usr --with-php-config=php-config8
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test TESTS=--show-diff
	php8 -dextension=modules/csv.so --ri csv
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/php8/conf.d
	install -d $_confdir
	echo "extension=csv" > $_confdir/csv.ini
}

sha512sums="
43213f2df4b074631b1dcb175b5103d652d06708d1b198e3775ad9a0ac588baa27963d5ff218e67b663f8afc4dbd40574933373af44219a74278905af942d5bb  php-pecl-CSV-0.4.2.tgz
"
